package com.jacky.iot.resources;

import org.eclipse.californium.core.CoapResource;
import org.eclipse.californium.core.server.resources.CoapExchange;

public abstract class AbstractCoapResource extends CoapResource {
    public AbstractCoapResource(String name) {
        super(name);
    }

    @Override
    public void handleGET(CoapExchange exchange) {
        processGetRequest(exchange);
    }

    @Override
    public void handlePOST(CoapExchange exchange) {
        processPostRequest(exchange);
    }

    protected abstract void processGetRequest(CoapExchange exchange);

    protected abstract void processPostRequest(CoapExchange exchange);
}
